package define

import (
	"time"

	"github.com/dgrijalva/jwt-go"
)

var (
	// Jwtkey 密钥
	Jwtkey = "sys-admin"
	// TokenExpire token 有效期 7天
	TokenExpire = time.Now().Add(time.Second * 3600 * 24 * 7).Unix()
	// RefreshTokenExpire 刷新token有效期14天
	RefreshTokenExpire = time.Now().Add(time.Second * 3600 * 24 * 14).Unix()
	// DefaultSize 默认分页没有显示条数
	DefaultSize = 10
	// 静态文件目录
	StaticResource = "./static"
	//邮件发送方
	EmailFrom = "1012928556@qq.com"
	//邮箱授权码
	EmailPassWord = "qhlnnnatqjeybfje"
	//邮箱host
	EmailHost = "smtp.qq.com"
	//邮箱端口号
	EmailPort = "587"
	//ip2region 存放路径
	DbPath = StaticResource + "/ip2region.xdb"
)

type UserClaim struct {
	Id      uint
	Name    string
	IsAdmin bool //是否是超管
	RoleId  uint //所属角色
	jwt.StandardClaims
}
